package com.xiaoma.tpo.resource;

public enum ForumType {

    T1(1,"机经"),T2(2,"口语"),T3(3,"写作"),T4(4,"阅读"),T5(5,"听力");
    
    private int code;
    private String text;
    
    private ForumType(int code, String text){
        this.code = code;
        this.text = text;
    }
    
    public String getText() {
        return this.text;
    }
    
    public int getCode() {
        return this.code;
    }
    
    public static String code2Text(int code) {
        switch(code){
        case 1: 
            return T1.getText();
        case 2: 
            return T2.getText();
        case 3: 
            return T3.getText();
        case 4: 
            return T4.getText();
        case 5: 
            return T5.getText();
        default:
            return "";
        }
    }
}
